home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 September
/
CHIP NET Rehberi Eylül 1998.iso
/
ftp
/
iftp21
/
EXAMPLES.ZIP
/
EXAM13.FTP
< prev
next >
Wrap
Text File
|
1997-12-20
|
2KB
|
69 lines
//
// NOTE: interactive keyboard script commands was disabled in iFTP v2.0
// due to OS compatibility problems. It will be added once it is
// fully tested for Win 95 and Win NT 3.51/4.0
//
// Script illustrating the following commands:
//
// Readkey
// ChoiceKey <chars> [delay]
// if lastkey <char> then
// if readkey <char> then
// if keypressed then
//
Write "Step 1: Waiting for key pressed... "
label keyloop1
if not keypressed then goto keyloop1
Readkey
Writeln Key Pressed! char = "%lastchar%" code = %lastkey%
Write "Step 2: Press ANY KEY to continue... "
if ReadKey <cr> then begin
writeln Carriage return hit!
else
Writeln Key pressed! char = "%lastchar%" code = %lastkey%
endif
Write "Step 3: Waiting for key pressed.. "
label keyloop3
if not keypressed then goto keyloop3
Readkey
Writeln Key pressed! char = "%lastchar%" code = %lastkey%
//
// Lets wait for a Y or N character, infinite wait
//
Write "Step 4: Press N or Y: "
ChoiceKey NY
if lastkey N then writeln N was pressed
if lastkey Y then writeln Y was pressed
//
// Do it again but with a 10 second timeout
//
Write "Step 5: Press N or Y (10 sec wait) : "
ChoiceKey NY 10 secs
if lastkey N then writeln N was pressed
if lastkey Y then writeln Y was pressed
//
// Do it again using <cr> as a default
//
Write "Step 6: Press [Y] [n] : "
ChoiceKey NY<cr>
if lastkey <cr> then writeln ENTER was hit. Default is N
if lastkey N then writeln N was pressed
if lastkey Y then writeln Y was pressed
Writeln done!